﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace AUV5.DAL.Handler
{
    public class ShareHandler
    {
        public IList<Model.WorksShare> sharelist = new List<Model.WorksShare>();
        public void GetFullList(object sender, object parameterObj, IList list)
        {
            Model.WorksShare share = GetFullObject(sender);
            if (share != null)
            {
                sharelist.Add(share);
            }
        }
        public Model.WorksShare GetFullObject(object sender)
        {
            try
            {
                if (sender != null)
                {
                    //获取用信息
                    Model.WorksShare share = (Model.WorksShare)sender;
                    Model.UserInfo user = new Model.UserInfo();
                    user.UserID = share.UserID;
                    Model.UserInfo adder = new Model.UserInfo();
                    adder = Dao.UserInfoSqlMapDao.Instance.GetDetail(user);
                    share.User = adder;

                    Hashtable ht = new Hashtable();
                    ht.Add("ServiceID", share.ServiceID);

                    share.ServiceInfo = Dao.ServiceInfoSqlMapDao.Instance.GetDetail(ht);

                    return share;
                }
                else
                {
                    return null;
                }
            }
            catch (Exception e)
            {
                throw new Exception("Error executing ShareHandler,  Cause: " + e.Message, e);
            }

        }
    }
}
